﻿<%@ Control Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script type="text/javascript">

        function render(value, metadata, record, rowIndex, colIndex, store) {
            var retVal = '';
            if (colIndex == 0 && record.data.DayTime == 'AM') {
                var fullDate = value.toString().substring(0, 10);
                var day = fullDate.substring(8, 10);
                var year = fullDate.substring(0, 4);
                var month = fullDate.substring(5, 7);
                if (year != '1900')
                    retVal = day + "/" + month + "/" + year;
                else
                    retVal = '';
            }
            return retVal;
        }
    </script>

<ext:GridPanel ID="GridTourDetail" runat="server" Header="false" Border="false" TrackMouseOver="true" StoreID="dsListTourDetail"
    Height="400" Layout="FitLayout" AutoScroll="true" AutoExpandColumn ="Gift1">
    <ColumnModel ID="ColumnModel1" runat="server">
        <Columns>
            <ext:Column ColumnID="TourDate" DataIndex="TourDate" Header="Date" Width="60" >
                <Renderer Fn="render" />
            </ext:Column>

            <ext:Column ColumnID="DayTime" DataIndex="DayTime" Header="Time" Width="30" />
            <ext:Column ColumnID="GuestNum" DataIndex="GuestNum" Header="Guest" Width="40">
                <Editor>
                    <ext:NumberField ID="txtGuestNum" runat="server" AllowBlank="true" />
                </Editor>
            </ext:Column>
            <ext:Column ColumnID="RoomNum" DataIndex="RoomNum" Header="Room" Width="40">
                <Editor>
                    <ext:NumberField ID="txtRoomNum" runat="server" AllowBlank="true" />
                </Editor>
            </ext:Column>
            <ext:Column ColumnID="Program" DataIndex="Program" Header="Program" Width="200">
                <Editor>
                    <ext:TextField ID="txtProgram" runat="server" AllowBlank="true" />
                </Editor>
            </ext:Column>
            <ext:Column ColumnID="TourGuideName" DataIndex="TourGuideName" Header="TourGuide"
                Width="100">
                <Editor>
                    <ext:ComboBox ID="TourGuideName" runat="server" StoreID="dsTourGuide" Editable="true"
                        DisplayField="Name" ValueField="Name" TypeAhead="true" Mode="Local" ForceSelection="true"
                        Width="300" TriggerAction="All" SelectOnFocus="true">
                    </ext:ComboBox>
                </Editor>
            </ext:Column>
            <ext:Column ColumnID="HotelName" DataIndex="HotelName" Header="Hotel"
                Width="100">
                <Editor>
                    <ext:ComboBox ID="ComboBox1" runat="server" StoreID="dsHotel" Editable="true"
                        DisplayField="Name" ValueField="Name" TypeAhead="true" Mode="Local" ForceSelection="true"
                        Width="300" TriggerAction="All" SelectOnFocus="true">
                    </ext:ComboBox>
                </Editor>
            </ext:Column>
            <ext:Column ColumnID="VehicleName" DataIndex="VehicleName" Header="Vehicle"
                Width="100">
                <Editor>
                    <ext:ComboBox ID="ComboBox2" runat="server" StoreID="dsVehicle" Editable="true"
                        DisplayField="Name" ValueField="Name" TypeAhead="true" Mode="Local" ForceSelection="true"
                        Width="300" TriggerAction="All" SelectOnFocus="true">
                    </ext:ComboBox>
                </Editor>
            </ext:Column>
            <ext:Column ColumnID="RestaurantName" DataIndex="RestaurantName" Header="Restaurant"
                Width="100">
                <Editor>
                    <ext:ComboBox ID="ComboBox3" runat="server" StoreID="dsRestaurant" Editable="true"
                        DisplayField="Name" ValueField="Name" TypeAhead="true" Mode="Local" ForceSelection="true"
                        Width="300" TriggerAction="All" SelectOnFocus="true">
                    </ext:ComboBox>
                </Editor>
            </ext:Column>
            <ext:Column ColumnID="PartnerName" DataIndex="PartnerName" Header="Partner"
                Width="100">
                <Editor>
                    <ext:ComboBox ID="ComboBox4" runat="server" StoreID="dsPartner" Editable="true"
                        DisplayField="Name" ValueField="Name" TypeAhead="true" Mode="Local" ForceSelection="true"
                        Width="300" TriggerAction="All" SelectOnFocus="true">
                    </ext:ComboBox>
                </Editor>
            </ext:Column>

            <ext:Column ColumnID="Gift1" DataIndex="Gift1" Header="SIMGift" >
                <Editor>
                    <ext:TextField ID="TextField111" runat="server" AllowBlank="true" />
                </Editor>
            </ext:Column>
            <ext:Column ColumnID="LocationRoleName" DataIndex="LocationRoleName" Header="LocationRoleName"
                Width="100">
                <Editor>
                    <ext:ComboBox ID="ComboBox5" runat="server" StoreID="dsRole" Editable="true"
                        DisplayField="Name" ValueField="Name" TypeAhead="true" Mode="Local" ForceSelection="true"
                        Width="300" TriggerAction="All" SelectOnFocus="true">
                    </ext:ComboBox>
                </Editor>
            </ext:Column>

        </Columns>
    </ColumnModel>
    <SelectionModel>
        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
    </SelectionModel>
    <Listeners>
        <Command Fn="commandHandler" />
    </Listeners>
    <LoadMask ShowMask="true" />
    <SaveMask ShowMask="true" />
</ext:GridPanel>
